// 库存物品类型枚举
export enum InventoryItemType {
  CHEMICAL = 0, // 化学试剂
  ELECTRONIC = 1, // 电子元器件
  OTHER = 2, // 其他
}

// 库存项类型
export interface InventoryItem {
  id: string;
  name: string;
  type: InventoryItemType;
  casNo: string;
  purity: string;
  brand: string;
  catalogNumber: string;
  // specs: string;
  unit: string;
  stockNum: string;
  location: string;
  expirationDate: string; // 格式: yyyy-MM-ddTHH:mm:ss，对应后端 LocalDateTime
  researchGroupId: string;
  researchGroupName: string;
  creatorName: string;
  createTime: string;
  subject:  string;
  warehousingTime: string;
}

// 创建库存项请求
export interface CreateInventoryItemRequest {
  name: string;
  type: InventoryItemType;
  casNo?: string;
  purity?: string;
  brand?: string;
  catalogNumber?: string;
  specs?: string;
  unit: string;
  stockNum: string;
  location?: string;
  expirationDate?: string; // 格式: yyyy-MM-ddTHH:mm:ss，对应后端 LocalDateTime
  researchGroupId: string;
  subject?: string;
}

// 获取物品类型名称
export function getItemTypeName(type: InventoryItemType): string {
  switch (type) {
    case InventoryItemType.CHEMICAL:
      return '化学试剂';
    case InventoryItemType.ELECTRONIC:
      return '电子元器件';
    case InventoryItemType.OTHER:
      return '其他';
    default:
      return '未知';
  }
}